package br.com.yetis.plugin.LoginOffline;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class LoginOffline extends JavaPlugin {

	public PlayerLoginOfflineListener playerListener;
	
	@Override
	public void onEnable() {

		playerListener = new PlayerLoginOfflineListener(this);
		
		PluginManager pm = getServer().getPluginManager();
		pm.registerEvents(playerListener, this);
		
		super.onEnable();
	}

	@Override
	public void onDisable() {
		// TODO Auto-generated method stub
		super.onDisable();
	}

	@Override
	public void onLoad() {
		// TODO Auto-generated method stub
		super.onLoad();
	}

	@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
		if (sender instanceof Player) {
			Player p = (Player) sender;
			if (label.equalsIgnoreCase("login")) {
				if (args.length == 0) {
					p.sendMessage("/login <Passwort...>");

				} else {
					p.sendMessage("Login sucessfully");
				}
			}
		}
		return false;
	}

	public boolean isLoggedIn(final Player player)
	{
		return false;
	}
}
